﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SmartSapce.ServiceLocation;
using SmartSpace.OA;
using SmartSpace.Web;

namespace SmartSpace.WebApp.Modules.OA.Pages
{
    public partial class WorkLog_Write : SsTemplatePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this._ctlTxtTime.Text = DateTime.Now.ToString("yyyy年MM月dd日 hh点");
        }

        protected void _ctlBtnSave_Click(object sender, EventArgs e)
        {
            WorkLog log = new WorkLog();
            log.Id = Guid.NewGuid();
            log.Account = this.User.Identity.Name;
            log.LogDate = DateTime.Now.Date;
            log.LogTime = DateTime.Now;
            log.Content = this._ctlEditContent.Text;
            IOAService service = ServiceLocator.Get<IOAService>();
            service.SaveWorkLog(log);
            Response.Redirect("./WorkLog-list.aspx");
        }
    }
}